package com.xydpeng.tech.common.pojo;

import com.xydpeng.tech.common.enums.ResultCode;

import java.io.Serializable;

/**
 * @author xydpeng
 * @version v1.0
 * @date: 2024/12/16
 * @description:
 */
public class ComResult<T> implements Serializable {
    /**
     * 结果码
     */
    private int code;
    /**
     * 消息
     */
    private String msg;
    /**
     * 数据
     */
    private T data;

    public ComResult(ResultCode resultCode) {
        this(resultCode, null);
    }

    public ComResult(ResultCode resultCode, T data) {
        this(resultCode.getCode(), resultCode.getMessage(), data);
    }

    private ComResult(int code, String msg, T data) {
        this.code = code;
        this.msg = msg;
        this.data = data;
    }



}
